package com.wjh.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import lombok.extern.slf4j.Slf4j;

/**
 * SpringDoc API文档相关配置
 * @author wenjianhai
 * @date 2023/5/16
 * @since JDK 17
 */
@Slf4j
@Configuration
public class SpringDocConfig {
    @Bean
    public OpenAPI mallTinyOpenAPI() {
        log.info("初始化OpenAPI-开始");

        return new OpenAPI()
                .info(new Info().title("alipay API")
                        .description("alipay")
                        .version("v1.0.0")
                        .license(new License().name("Apache 2.0").url("https://github.com/macrozheng/mall-learning")))
                .externalDocs(new ExternalDocumentation()
                        .description("alipay")
                        .url("http://www.macrozheng.com"));
    }
}
